#include "TestState.h"

TestState::TestState()
{
    _debug = DebugLog::instance();
    _scriptMgr = ScriptManager::instance();
    //_debug->errorMessage("test state error");

    _eventMgr = EventManager::instance();
}

TestState::~TestState()
{
    //dtor
}


void TestState::init()
{
    luabind::globals(_scriptMgr->luaState())["sprite"] = &_sprite;
    _scriptMgr->runScript("testSprite.lua");
}

void TestState::render()
{
    _sprite.render();
}

void TestState::update()
{
   // _scriptMgr->runScript("testSpriteUpdate.lua");
}

void TestState::handleEvents(sf::Event& event)
{
    if(_eventMgr->keyPressed(sf::Keyboard::A))
    {

    }
    else if(_eventMgr->keyPressed(sf::Keyboard::D))
    {

    }
    else if(_eventMgr->keyPressed(sf::Keyboard::W))
    {

    }
    else if(_eventMgr->keyPressed(sf::Keyboard::S))
    {

    }
}






